import { ApiModelProperty } from "@nestjs/swagger";
import { prop } from "@typegoose/typegoose";
import { IsNotEmpty } from "class-validator";

export class Banner {
  @ApiModelProperty({ description: '轮播图标题', example: 'hahah' })
  @prop()
  @IsNotEmpty({ message: '请输入轮播图标题' })
  title!: string;

  @ApiModelProperty({ description: '轮播图标', example: 'https://shubuzuo.top/img/logo.jpg', required: false })
  @prop()
  url?: string;

  @ApiModelProperty({
    description: '排序权重', example:
      1
  })
  @prop()
  @IsNotEmpty({ message: '请输入排序权重' })
  index!: number;
}
